import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    host: '0.0.0.0', // 允许外部访问
    port: 5173,
    proxy: {
      '/lxt': {
        target: 'http://localhost:3001',
        changeOrigin: true,
        secure: false
      },
      '/users': {
        target: 'http://localhost:3001',
        changeOrigin: true,
        secure: false
      },
      '/dify': {
        target: 'http://localhost:3001',
        changeOrigin: true,
        secure: false
      }
    },
    allowedHosts: [
      'all',
      '13be2816e0e8.ngrok-free.app',
      'localhost',
      '127.0.0.1'
    ]
  },
}) 